/*
 * Author: Liviu Patrasco
 * TCSS 342 Winter qrt
 * May 22, 2011
 * Scheduler-svn
 */
package main;

import java.util.List;

/**
 * Abstract data user class.
 * <br><br>
 * Invariant: getUserName() != null && getPassword() != null
 * @author Liviu Patrasco
 * @version May 22, 2011
 */
public abstract class DataUser {
	private String my_userName;
	private String my_password;
	private List<Course> my_CoursePrefs;

	/**
	 * Protected constructor.
	 */
	protected DataUser(final String the_userName, final String the_pswrd) {
		my_userName = the_userName;
		my_password = the_pswrd;
	}


	/**
	 * Sets the user name to given one.
	 */
	public void setUserName(String my_name) {
		this.my_userName = my_name;
	}
	/**
	 * Returns the user name.
	 */
	public String getUserName() {
		return my_userName;
	}
	/**
	 * Sets the password to specified.
	 */
	public void setPassword(String my_password) {
		this.my_password = my_password;
	}
	/**
	 * Returns the user's password.
	 */
	public String getPassword() {
		return my_password;
	}
	/**
	 * Sets preferences to given ones.
	 */
	public void setCoursePrefs(List<Course> my_preffs) {
		this.my_CoursePrefs = my_preffs;
	}
	/**
	 * Returns course preferences.
	 */
	public List<Course> getCoursePrefs() {
		return my_CoursePrefs;
	}
	/**
	 * Verifies if the given password matches with the user's password.
	 */
	public boolean checkPassword(final String the_pswrd) {
		return the_pswrd == my_password;
	}
}
